/*package com.yihaodian.search.core;

import org.apache.log4j.Logger;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.IndexSearcher;

import com.yihaodian.api.search.SearchException;
import com.yihaodian.search.searcher.Searcher;

public class ZoieSearcher<R extends IndexReader> implements Searcher{
	
	private static Logger logger = Logger.getLogger(ZoieSearcher.class);
	
	IndexSearcher _indexSearcher;
	
	IndexReader _indexReader;
	
	ZoieSearcherFactory<R> _zoieSearcherFactory;
	
	
	public ZoieSearcher(ZoieSearcherFactory<R> zoieSearcherFactory,IndexSearcher indexSearcher,IndexReader indexReader){
		_zoieSearcherFactory=zoieSearcherFactory;
		_indexSearcher=indexSearcher;
		_indexReader=indexReader;
	}

	@Override
	public boolean release() throws SearchException {  
		try{
			if(_indexReader!=null){
				_indexReader.close();
			}
		}catch(Exception e){
			logger.error(e.getMessage(), e);
		}finally{
			if(_zoieSearcherFactory!=null && _indexReader!=null){
				_zoieSearcherFactory.decRefReader(_indexReader);
			}			
		}
        return true;
	}

	@Override
	public IndexReader reader() {
		return _indexReader;
	}

	@Override
	public IndexSearcher searcher() {
		return _indexSearcher;
	}

}
*/